home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: New Zealand Amiga Users Group / New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).zip / New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).adf / StrucBrowser / sb.src.zoo / SBScreen.c < prev    next >
C/C++ Source or Header  |  1988-06-22  |  4KB  |  115 lines

  1. /************************************************************************
  2. *                                    *
  3. *                SBScreen                *
  4. *                                    *
  5. *************************************************************************/
  6.  
  7. /* include not needed for Aztec C using provided makefile */
  8. #include "sb:sb.h"
  9. extern int level;
  10. extern void PrScreen2(); 
  11.  
  12. void PrScreen(string, screen) char *string; struct Screen *screen;
  13. {
  14. static struct StructData structdata[] = {
  15.      { " NextScreen",   "struct Screen *",     5, PTRSIZE    },
  16.      { " FirstWindow",  "struct Window *",     5, PTRSIZE    },
  17.      { "-LeftEdge",     "SHORT",               2, INTSIZE    },
  18.      { "-TopEdge",      "SHORT",               2, INTSIZE    },
  19.      { "-Width",        "SHORT",               2, INTSIZE    },
  20.      { "-Height",       "SHORT",               2, INTSIZE    },
  21.      { "-MouseY",       "SHORT",               2, INTSIZE    },
  22.      { "-MouseX",       "SHORT",               2, INTSIZE    },
  23.      { " Flags",        "USHORT",             12, INTSIZE    },
  24.      { " Title",        "UBYTE *",             4, PTRSIZE    },
  25.      { " DefaultTitle", "UBYTE *",             4, PTRSIZE    },
  26.      { "-BarHeight",    "BYTE",                3, BYTESIZE   },
  27.      { "-BarVBorder",   "BYTE",                3, BYTESIZE   },
  28.      { "-BarHBorder",   "BYTE",                3, BYTESIZE   },
  29.      { "-MenuVBorder",  "BYTE",                3, BYTESIZE   },
  30.      { "-MenuHBorder",  "BYTE",                3, BYTESIZE   }
  31.   };
  32. static char *flagnames[8] = {
  33.     "WBENCHSCREEN",    "CUSTOMSCREEN",  NULL,             NULL,
  34.     "SHOWTITLE",       "BEEPING",       "CUSTOMBITMAP",   NULL
  35.   };
  36. int sum, choice = -1;
  37. ULONG bits;
  38.   level++;
  39.   while (choice) {
  40.   sum = SetOptionText(string, structdata,
  41.                       (APTR)screen, DATASIZE, 0);
  42.   switch (choice = GetChoice(MAXGADG + 1)) {
  43.     case 1:
  44.       if (screen->NextScreen)
  45.         PrScreen("The next screen in Intuition's list", screen->NextScreen);
  46.       break;
  47.     case 2:
  48.       if (screen->FirstWindow)
  49.         PrWindow("The screen's first window", screen->FirstWindow);
  50.       break;
  51.     case 9:
  52.       if ((bits = screen->Flags) & 2)
  53.         bits ^= 1;
  54.       FlagPrint("The screen's flags", flagnames, bits);
  55.       break;
  56.     case 10:
  57.       PrString("The Screen's Title", screen->Title);
  58.       break;
  59.     case 11:
  60.       PrString("The Screen's Default Title", screen->DefaultTitle);
  61.       break;
  62.     case MOREGADG:
  63.       PrScreen2("Screen members (page 2)", screen, sum);
  64.       break;
  65.     }
  66.   }
  67.   level--;
  68. }
  69.  
  70.  
  71. void PrScreen2(string, screen, offset)
  72. char *string; struct Screen *screen; int offset;
  73. {
  74. static struct StructData structdata[] = {
  75.      { "-WBorTop",      "BYTE",                 3, BYTESIZE      },
  76.      { "-WBorLeft",     "BYTE",                 3, BYTESIZE      },
  77.      { "-WBorLeft",     "BYTE",                 3, BYTESIZE      },
  78.      { "-WBorBottom",   "BYTE",                 3, INTSIZE       },
  79.      { " Font",         "struct TextAttr *",    5, PTRSIZE       },
  80.      { "(ViewPort",     "struct ViewPort)",     0, SZ(ViewPort)  },
  81.      { " RastPort",     "struct RastPort ",     0, SZ(RastPort)  },
  82.      { " BitMap",       "struct BitMap",        0, SZ(BitMap)    },
  83.      { "(LayerInfo",    "struct Layer_Info)",   0, SZ(Layer_Info)},
  84.      { " FirstGadget",  "struct Gadget *",      5, PTRSIZE       },
  85.      { "-DetailPen",    "UBYTE",               13, BYTESIZE      },
  86.      { "-BlockPen",     "UBYTE",               13, BYTESIZE      },
  87.      { "-SaveColor0",   "USHORT",              12, INTSIZE       },
  88.      { "(BarLayer",     "struct Layer *)",      5, PTRSIZE       },
  89.      { "(ExtData",      "UBYTE *)",             5, PTRSIZE       },
  90.      { "(UserData",     "UBYTE *)",             5, PTRSIZE       },
  91.   };
  92. int sum, choice = -1;
  93.   level++;
  94.   while (choice) {
  95.     sum = SetOptionText(string, structdata, (APTR)screen, DATASIZE, offset);
  96.     switch (choice = GetChoice(DATASIZE)) {
  97.       case 5:
  98.         if (screen->Font)
  99.           PrTextAttr("Structure TextAttr",screen->Font);
  100.         break;
  101.       case 7:
  102.         PrRastPort("The screen's RastPort", &screen->RastPort);
  103.         break;
  104.       case 8:
  105.         PrBitMap("The screen's BitMap", &screen->BitMap);
  106.         break;
  107.       case 10:
  108.         if (screen->FirstGadget)
  109.           PrGadget("The screen's first gadget", screen->FirstGadget);
  110.         break;
  111.     }
  112.   }
  113.   level--;
  114. }
  115.